package com.zzy.chapter05.physicalpartition;

import com.zzy.chapter05.source.ClickSource;
import entity.Event;
import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

public class RebalanceTest {
    public static void main(String[] args) throws Exception {
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
        env.setParallelism(1);

        DataStreamSource<Event> source = env.addSource(new ClickSource());
        source.rebalance().print("rebalance").setParallelism(3);

        env.execute();
    }
}
